package com.example.ordersservice.client;

import com.example.commonutils.R;
import com.example.commonutils.vo.ShoppingCartCommon;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

@Component
@FeignClient("service-ordermeal")
public interface ShoppingCartClient {
    @GetMapping("/ordermealservice/shoppingcart/queryShoppingCartInfo/{id}")
    ShoppingCartCommon queryShoppingCartInfo(@PathVariable String id);
    //根据dishId和dishNumber减库存
    @PutMapping("/ordermealservice/orderdish/subNumber/{dishId}/{dishNumber}")
    R subNumber(@PathVariable("dishId") String dishId, @PathVariable("dishNumber") Integer dishNumber);
    @GetMapping("/ordermealservice/orderdish/selectTime/{dishId}")
    int selectTime(@PathVariable("dishId") String dishId);
    //通过id查询菜品的库存
    @GetMapping("/ordermealservice/shoppingcart/queryDishNumById/{id}")
    Integer queryDishNumById(@PathVariable("id") String id);
}
